package day006.api_gui.itheima03;

import day006.api_gui.itheima02.JButtonDemo;

import javax.swing.*;

public class UsewrLogin {
    public static void main(String[] args) {
        JFrame jf = new JFrame();
        jf.setTitle("用户登录");
        jf.setSize(400, 300);
        jf.setDefaultCloseOperation(3);
        jf.setLocationRelativeTo(null);
        jf.setAlwaysOnTop(true);
        jf.setLayout(null);

        JLabel usernameLabel = new JLabel("用户名：");
        usernameLabel.setBounds(50, 50, 50, 20);
        jf.add(usernameLabel);

        JTextField usernameField = new JTextField();
        usernameField.setBounds(150, 50, 180, 20);
        jf.add(usernameField);

        JLabel passwordLabel = new JLabel("密码：");
        passwordLabel.setBounds(50, 100, 50, 20);
        jf.add(passwordLabel);

        JPasswordField passwordField = new JPasswordField();
        passwordField.setBounds(150, 100, 180, 20);
        jf.add(passwordField);

        JButton loginButton = new JButton("登录");
        loginButton.setBounds(50, 200, 280, 20);
        jf.add(loginButton);

        jf.setVisible(true);

    }
}
